package com.yunkazaixian.syntelecom;

import com.yunkazaixian.syntelecom.utils.NettyClient;
import net.sf.json.xml.XMLSerializer;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableAsync;

@SpringBootApplication(exclude = {SecurityAutoConfiguration.class})
@MapperScan("com.yunkazaixian.syntelecom.mapper")
@EnableAsync
public class SyntelecomApplication {
    public static void main(String[] args) {
        SpringApplication.run(SyntelecomApplication.class, args);
    }

    @Bean
    public XMLSerializer xmlSerializer(){
        XMLSerializer xmlSerializer = new XMLSerializer();
        xmlSerializer.setSkipNamespaces(true);
        return xmlSerializer;
    }
    @Bean
    public NettyClient nettyClient() {

        NettyClient nettyClient = new NettyClient();
//        try {
//            nettyClient.start(9012);
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
        return nettyClient;
    }
}
